import 'package:fish_redux/fish_redux.dart';

import 'action.dart';
import 'state.dart';

Reducer<EngineerOrderViewState> buildReducer() {
  return asReducer(
    <Object, Reducer<EngineerOrderViewState>>{
      EngineerOrderViewAction.action: _onAction,
      EngineerOrderViewAction.onSetStep: _onSetStep,
    },
  );
}

EngineerOrderViewState _onAction(EngineerOrderViewState state, Action action) {
  final EngineerOrderViewState newState = state.clone();
  return newState;
}

EngineerOrderViewState _onSetStep(EngineerOrderViewState state, Action action) {
  final EngineerOrderViewState newState = state.clone()..step = action.payload;
  return newState;
}
